<?php


namespace app\api\controller;


use app\common\controller\Api;

class ProtocolAirline extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];




    /**
     * 获取地区列表
     */
    public function getAreaList(\app\common\model\ProtocolAirlineModel $ProtocolAirlineModel){
        $data = $ProtocolAirlineModel->getAreaList();
        $this->result($data['msg'], $data['data'], $data['code']);
    }



    /**
     * 获取分页列表
     * @ApiMethod GET
     * @param string $area_mold 省市区类型:all,province,city,area
     * @param string|int $area_id 省市区id
     * @param string $search 搜索
     */
    public function getPageList(\app\common\model\ProtocolAirlineModel $ProtocolAirlineModel){
        $params = $this->request->get();
        $user_id = $this->auth->id;
        $page = $this->request->request('page');
        $limit = $this->request->request('limit');
        $data = $ProtocolAirlineModel->getPageList($params, $user_id, $page, $limit);
        $this->result($data['msg'], $data['data'], $data['code']);
    }

    /**
     * 获取详情
     */
    public function getDetail(\app\common\model\ProtocolAirlineModel $ProtocolAirlineModel){
        $id = $this->request->request('id');
        if(empty($id)){
            $this->error('请求参数错误');
        }
        $data = $ProtocolAirlineModel->getDetail($id);
        $this->result($data['msg'], $data['data'], $data['code']);
    }

}